package com.example.superoa.model.service;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.example.superoa.model.dao.RankApprovalDao;
import com.example.superoa.model.dao.StaffDao;
import com.example.superoa.model.mappers.RankMapper;
import com.example.superoa.model.mappers.StaffMapper;
import com.example.superoa.model.pojos.RankApproval;
import com.example.superoa.model.pojos.Staff;
import com.example.superoa.model.vo.RankVo;

@Service
@Transactional(rollbackFor=Exception.class)
public class RankAppService {
	@Autowired
	private RankApprovalDao rankappdao;
	
	@Autowired
	private RankMapper ranmapper;
	
	@Autowired
	private StaffDao staffdao;
	
	@Autowired
	private StaffMapper smapper;
	//新增员工离职信息
	public void rankadd(RankApproval r,Staff s,String rank_appstate) {
		rankappdao.save(r);
	}
	
	//查询离职员工信息
	public List<RankVo> rankselect(){
		return ranmapper.rankselect();
		
	}
	
	//离职审核
	public void rankstate(String rank_appstate,int rank_id,Staff s) {
		ranmapper.rankstate(rank_appstate, rank_id);
	}
	public void staffstaxx(String Staff_sfzz,int staff_id) {
		smapper.staffstaxx(Staff_sfzz, staff_id);
	}

	//根据id查询信息
	public RankVo selectrankByid(int rank_id) {
		return ranmapper.selectrankByid(rank_id);
	}
	//查询离职结果
	public List<RankVo> ranksheAll(){
		return ranmapper.ranksheAll();
	}
}
